# xpath的基本使用
# import requests
# from lxml import etree
#
#
# url = 'https://jx.tmall.com/?spm=a219t.7664554.1998457203.159.hWZb4X&ali_trackid=2:mm_130402922_1111150093_109790100207:1594204252_272_794790795'
# response = requests.get(url)
# response.encoding = 'utf-8'
# html = etree.HTML(response.text)
# data = html.xpath('//*[@id="content"]/div[2]/div[1]/div[1]/ul/li[1]/div[2]/a[5]/text()')
# print(data)



# from bs4 import BeautifulSoup
# from lxml import etree
# import requests
# def get_url_connection(url):
#     response = requests.get(url)
#     return response
# def get_data(url):
#     result = get_url_connection(url)
#     text = result.text
#     content = result.content
#     return text
# def spider(url):
#     data = get_data(url)
#     if data:
#         print('爬取成功')
#         print(data)
#     else:
#         print('爬取失败')
#
# if __name__ == '__main__':
#     url = input('请输入你要爬取的网址')
#     spider(url)


